package com.googlecode.ozonbooksfinder.cairngormfinder.control
{
	import com.adobe.cairngorm.control.FrontController;
	import com.googlecode.ozonbooksfinder.cairngormfinder.command.GetBookDetailsCommand;
	import com.googlecode.ozonbooksfinder.cairngormfinder.command.GetBookInfoCommand;
	import com.googlecode.ozonbooksfinder.cairngormfinder.command.GetBooksCommand;
	import com.googlecode.ozonbooksfinder.cairngormfinder.command.GetFavoritesCommand;
	import com.googlecode.ozonbooksfinder.cairngormfinder.command.RemoveFavoriteCommand;
	import com.googlecode.ozonbooksfinder.cairngormfinder.command.SaveFavoriteCommand;
	import com.googlecode.ozonbooksfinder.cairngormfinder.command.ShowViewCommand;
	
	public class CairngormFinderController extends FrontController
	{
		public function CairngormFinderController()
		{
			initializeCommands();
		}
		
		public function initializeCommands() : void
		{
			addCommand(CairngormFinderController.EVENT_GET_BOOKS, GetBooksCommand);
			addCommand(CairngormFinderController.EVENT_SHOW_VIEW, ShowViewCommand);
			addCommand(CairngormFinderController.EVENT_GET_BOOK_DETAILS, GetBookDetailsCommand);
			addCommand(CairngormFinderController.EVENT_GET_BOOK_INFO, GetBookInfoCommand);
			
			addCommand(CairngormFinderController.EVENT_GET_FAVORITES, GetFavoritesCommand);
			addCommand(CairngormFinderController.EVENT_SAVE_FAVORITES, SaveFavoriteCommand);
			addCommand(CairngormFinderController.EVENT_REMOVE_FAVORITES, RemoveFavoriteCommand);
		}
		
		public static const EVENT_SHOW_VIEW:String = "showView";
		
		public static const EVENT_GET_BOOKS:String = "getBooks";
		
		public static const EVENT_GET_BOOK_DETAILS:String = "getBookDetails";
		
		public static const EVENT_GET_BOOK_INFO:String = "getBookInfo";
		
		public static const EVENT_GET_FAVORITES:String = "getFavorites";
		
		public static const EVENT_SAVE_FAVORITES:String = "saveFavorites";
		
		public static const EVENT_REMOVE_FAVORITES:String = "removeFavorites";
	}
}